<template>
  <div class="app">
    <h2>{{ wanju }}</h2>
    <Child :house="house" :money="money" :car="car" :sendToy="getToy"/>
  </div>
</template>

<script>
  import Child from './components/Child.vue'

  export default {
    name:'App',
    components:{Child},
    data() {
      return {
        house:'大别墅',
        money:1000,
        car:'奔驰c63',
        wanju:''
      }
    },
    methods: {
      getToy(value){
        // console.log('App组件中的a方法被调用了',value)
        // alert(value)
        // this.$refs.title.innerText = value
        this.wanju = value
      }
    },
  }
</script>

<style>
  .app {
    background-color: #ddd;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px;
  }
</style>